package com.x.controller;

import com.xxx.annotation.MyLogger;
import com.xxx.annotation.TimeCost;
import com.xxx.service.XDemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * the class of advance
 *
 * <p>
 * .
 *
 * @author little_lunatic
 * @date 2024-06-14
 */
@RestController
public class XDemoStarterController {

    @Autowired
    @Lazy
    private XDemoService xDemoService;

    /**
     * 向指定的人打招呼。
     *
     * @param name 接收打招呼的人的名字。
     * @return 包含问候语和名字的字符串。
     */
    @TimeCost
    @MyLogger(desciption = "接口信息")
    @GetMapping("/hello/{name}")
    public String sayHello(@PathVariable("name") String name) {
        return xDemoService.sayHello(name);
    }
}
